package h_eekwan.basic;

import java.util.Scanner;

public class ex237Main {
	private static String title = "공연 예약 시스템입니다. " + "\n" + " java Reserve";
	private static String menu = " (1) 예약	(2) 조회	(3) 취소	(4) 종료";
	private static String addmsg = "좌석구분   <1>S석		<2>A석		<3>B석";
	private static String showmsg = "조회를 완료하였습니다.";
	private static String exitmsg = " 프로그램을 종료하겠습니다. ";
	
	public static void main(String[] args) {
		ex237 re = new ex237();
		ex237VO v = new ex237VO();
		
		Scanner sc = new Scanner(System.in);
		System.out.println( title );
		while(true){
		System.out.println( menu );
			switch(sc.nextInt()){
				case 1 : addRes(sc, re);
					break;
				case 2 : showRes(re);
					break;
				case 3 : upRes(sc, re);
					break;
				case 4 : sc.close();
						System.exit(0);
						System.out.println(exitmsg);						
						break;
				
			}	// switch
		}	// while		

		
	}	//main
	
	private static void addRes(Scanner sc, ex237 re){
		System.out.println( addmsg);
		ex237VO v = new ex237VO(sc.next(), sc.nextInt(), sc.nextInt());
		re.addRes(v);
	
		
	}

	private static void showRes(ex237 re) {		
		System.out.println(re.readRes());
		
		
		
		System.out.println(showmsg);
	}
	
	private static void upRes(Scanner sc, ex237 re){
		System.out.println(addmsg);
		
//		ex237VO v = new ex237VO(sc.next());
		ex237VO v = new ex237VO(sc.nextInt(), sc.nextInt());
		re.upRes(v);
		
		
	}	
	
	
}	//class
